<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QAbstractItemModel Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QAbstractItemModel Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QAbstractItemModel class provides the abstract interface for
item model classes. <a href="#details">More...</a></p>

<p>Inherits <a href="qobject.html">QObject</a>.</p><p>Inherited by <a href="qabstractlistmodel.html">QAbstractListModel</a>, <a href="qabstractproxymodel.html">QAbstractProxyModel</a>, <a href="qabstracttablemodel.html">QAbstractTableModel</a>, <a href="qdirmodel.html">QDirModel</a>, <a href="qfilesystemmodel.html">QFileSystemModel</a>, <a href="qhelpcontentmodel.html">QHelpContentModel</a>, <a href="qproxymodel.html">QProxyModel</a> and <a href="qstandarditemmodel.html">QStandardItemModel</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qabstractitemmodel.html#QAbstractItemModel">__init__</a></b> (<i>self</i>, QObject&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#beginInsertColumns">beginInsertColumns</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>, int&#160;<i>first</i>, int&#160;<i>last</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>, int&#160;<i>first</i>, int&#160;<i>last</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#beginMoveColumns">beginMoveColumns</a></b> (<i>self</i>, QModelIndex&#160;<i>sourceParent</i>, int&#160;<i>sourceFirst</i>, int&#160;<i>sourceLast</i>, QModelIndex&#160;<i>destinationParent</i>, int&#160;<i>destinationColumn</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#beginMoveRows">beginMoveRows</a></b> (<i>self</i>, QModelIndex&#160;<i>sourceParent</i>, int&#160;<i>sourceFirst</i>, int&#160;<i>sourceLast</i>, QModelIndex&#160;<i>destinationParent</i>, int&#160;<i>destinationRow</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#beginRemoveColumns">beginRemoveColumns</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>, int&#160;<i>first</i>, int&#160;<i>last</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#beginRemoveRows">beginRemoveRows</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>, int&#160;<i>first</i>, int&#160;<i>last</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#beginResetModel">beginResetModel</a></b> (<i>self</i>)</li><li><div class="fn" />QModelIndex <b><a href="qabstractitemmodel.html#buddy">buddy</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#canFetchMore">canFetchMore</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#changePersistentIndex">changePersistentIndex</a></b> (<i>self</i>, QModelIndex&#160;<i>from</i>, QModelIndex&#160;<i>to</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#changePersistentIndexList">changePersistentIndexList</a></b> (<i>self</i>, list-of-QModelIndex&#160;<i>from</i>, list-of-QModelIndex&#160;<i>to</i>)</li><li><div class="fn" />int <b><a href="qabstractitemmodel.html#columnCount">columnCount</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />QModelIndex <b><a href="qabstractitemmodel.html#createIndex">createIndex</a></b> (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, object&#160;<i>object</i>&#160;=&#160;0)</li><li><div class="fn" />QVariant <b><a href="qabstractitemmodel.html#data">data</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>, int&#160;<i>role</i>&#160;=&#160;Qt.DisplayRole)</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#decodeData">decodeData</a></b> (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, QModelIndex&#160;<i>parent</i>, QDataStream&#160;<i>stream</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#dropMimeData">dropMimeData</a></b> (<i>self</i>, QMimeData&#160;<i>data</i>, Qt.DropAction&#160;<i>action</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, QModelIndex&#160;<i>parent</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#encodeData">encodeData</a></b> (<i>self</i>, list-of-QModelIndex&#160;<i>indexes</i>, QDataStream&#160;<i>stream</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#endInsertColumns">endInsertColumns</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#endInsertRows">endInsertRows</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#endMoveColumns">endMoveColumns</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#endMoveRows">endMoveRows</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#endRemoveColumns">endRemoveColumns</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#endRemoveRows">endRemoveRows</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#endResetModel">endResetModel</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#fetchMore">fetchMore</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>)</li><li><div class="fn" />Qt.ItemFlags <b><a href="qabstractitemmodel.html#flags">flags</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#hasChildren">hasChildren</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#hasIndex">hasIndex</a></b> (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />QVariant <b><a href="qabstractitemmodel.html#headerData">headerData</a></b> (<i>self</i>, int&#160;<i>section</i>, Qt.Orientation&#160;<i>orientation</i>, int&#160;<i>role</i>&#160;=&#160;Qt.DisplayRole)</li><li><div class="fn" />QModelIndex <b><a href="qabstractitemmodel.html#index">index</a></b> (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#insertColumn">insertColumn</a></b> (<i>self</i>, int&#160;<i>column</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#insertColumns">insertColumns</a></b> (<i>self</i>, int&#160;<i>column</i>, int&#160;<i>count</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#insertRow">insertRow</a></b> (<i>self</i>, int&#160;<i>row</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#insertRows">insertRows</a></b> (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>count</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />dict-of-int-QVariant <b><a href="qabstractitemmodel.html#itemData">itemData</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />list-of-QModelIndex <b><a href="qabstractitemmodel.html#match">match</a></b> (<i>self</i>, QModelIndex&#160;<i>start</i>, int&#160;<i>role</i>, QVariant&#160;<i>value</i>, int&#160;<i>hits</i>&#160;=&#160;1, Qt.MatchFlags&#160;<i>flags</i>&#160;=&#160;Qt.MatchStartsWith|Qt.MatchWrap)</li><li><div class="fn" />QMimeData <b><a href="qabstractitemmodel.html#mimeData">mimeData</a></b> (<i>self</i>, list-of-QModelIndex&#160;<i>indexes</i>)</li><li><div class="fn" />QStringList <b><a href="qabstractitemmodel.html#mimeTypes">mimeTypes</a></b> (<i>self</i>)</li><li><div class="fn" />QModelIndex <b><a href="qabstractitemmodel.html#parent">parent</a></b> (<i>self</i>, QModelIndex&#160;<i>child</i>)</li><li><div class="fn" />QObject <b><a href="qabstractitemmodel.html#parent-2">parent</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-QModelIndex <b><a href="qabstractitemmodel.html#persistentIndexList">persistentIndexList</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#removeColumn">removeColumn</a></b> (<i>self</i>, int&#160;<i>column</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#removeColumns">removeColumns</a></b> (<i>self</i>, int&#160;<i>column</i>, int&#160;<i>count</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#removeRow">removeRow</a></b> (<i>self</i>, int&#160;<i>row</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#removeRows">removeRows</a></b> (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>count</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#reset">reset</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#resetInternalData">resetInternalData</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#revert">revert</a></b> (<i>self</i>)</li><li><div class="fn" />dict-of-int-QByteArray <b><a href="qabstractitemmodel.html#roleNames">roleNames</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qabstractitemmodel.html#rowCount">rowCount</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#setData">setData</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>, QVariant&#160;<i>value</i>, int&#160;<i>role</i>&#160;=&#160;Qt.EditRole)</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#setHeaderData">setHeaderData</a></b> (<i>self</i>, int&#160;<i>section</i>, Qt.Orientation&#160;<i>orientation</i>, QVariant&#160;<i>value</i>, int&#160;<i>role</i>&#160;=&#160;Qt.EditRole)</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#setItemData">setItemData</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>, dict-of-int-QVariant&#160;<i>roles</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#setRoleNames">setRoleNames</a></b> (<i>self</i>, dict-of-int-QByteArray&#160;<i>roleNames</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#setSupportedDragActions">setSupportedDragActions</a></b> (<i>self</i>, Qt.DropActions)</li><li><div class="fn" />QModelIndex <b><a href="qabstractitemmodel.html#sibling">sibling</a></b> (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, QModelIndex&#160;<i>idx</i>)</li><li><div class="fn" /><b><a href="qabstractitemmodel.html#sort">sort</a></b> (<i>self</i>, int&#160;<i>column</i>, Qt.SortOrder&#160;<i>order</i>&#160;=&#160;Qt.AscendingOrder)</li><li><div class="fn" />QSize <b><a href="qabstractitemmodel.html#span">span</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />bool <b><a href="qabstractitemmodel.html#submit">submit</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.DropActions <b><a href="qabstractitemmodel.html#supportedDragActions">supportedDragActions</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.DropActions <b><a href="qabstractitemmodel.html#supportedDropActions">supportedDropActions</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qabstractitemmodel.html#columnsAboutToBeInserted">columnsAboutToBeInserted</a></b> (const QModelIndex&amp;,int,int)</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#columnsAboutToBeMoved">columnsAboutToBeMoved</a></b> (const QModelIndex&amp;,int,int,const QModelIndex&amp;,int)</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#columnsAboutToBeRemoved">columnsAboutToBeRemoved</a></b> (const QModelIndex&amp;,int,int)</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#columnsInserted">columnsInserted</a></b> (const QModelIndex&amp;,int,int)</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#columnsMoved">columnsMoved</a></b> (const QModelIndex&amp;,int,int,const QModelIndex&amp;,int)</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#columnsRemoved">columnsRemoved</a></b> (const QModelIndex&amp;,int,int)</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#dataChanged">dataChanged</a></b> (const QModelIndex&amp;,const QModelIndex&amp;)</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#headerDataChanged">headerDataChanged</a></b> (Qt::Orientation,int,int)</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#layoutAboutToBeChanged">layoutAboutToBeChanged</a></b> ()</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#layoutChanged">layoutChanged</a></b> ()</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#modelAboutToBeReset">modelAboutToBeReset</a></b> ()</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#modelReset">modelReset</a></b> ()</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#rowsAboutToBeInserted">rowsAboutToBeInserted</a></b> (const QModelIndex&amp;,int,int)</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#rowsAboutToBeMoved">rowsAboutToBeMoved</a></b> (const QModelIndex&amp;,int,int,const QModelIndex&amp;,int)</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#rowsAboutToBeRemoved">rowsAboutToBeRemoved</a></b> (const QModelIndex&amp;,int,int)</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#rowsInserted">rowsInserted</a></b> (const QModelIndex&amp;,int,int)</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#rowsMoved">rowsMoved</a></b> (const QModelIndex&amp;,int,int,const QModelIndex&amp;,int)</li><li><div class="fn" />void <b><a href="qabstractitemmodel.html#rowsRemoved">rowsRemoved</a></b> (const QModelIndex&amp;,int,int)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QAbstractItemModel class provides the abstract interface for
item model classes.</p>
<p>The QAbstractItemModel class defines the standard interface that
item models must use to be able to interoperate with other
components in the model/view architecture. It is not supposed to be
instantiated directly. Instead, you should subclass it to create
new models.</p>
<p>The QAbstractItemModel class is one of the <a href="model-view.html">Model/View Classes</a> and is part of Qt's
<a href="model-view-programming.html">model/view framework</a>.</p>
<p>If you need a model to use with a <a href="qlistview.html">QListView</a> or a <a href="qtableview.html">QTableView</a>, you should consider subclassing
<a href="qabstractlistmodel.html">QAbstractListModel</a> or
<a href="qabstracttablemodel.html">QAbstractTableModel</a> instead
of this class.</p>
<p>The underlying data model is exposed to views and delegates as a
hierarchy of tables. If you do not make use of the hierarchy, then
the model is a simple table of rows and columns. Each item has a
unique index specified by a <a href="qmodelindex.html">QModelIndex</a>.</p>
<p class="centerAlign"><img alt="" src="images/modelindex-no-parent.png" /></p>
<p>Every item of data that can be accessed via a model has an
associated model index. You can obtain this model index using the
<a href="qabstractitemmodel.html#index">index</a>() function. Each
index may have a <a href="qabstractitemmodel.html#sibling">sibling</a>() index; child items
have a <a href="qabstractitemmodel.html#parent">parent</a>()
index.</p>
<p>Each item has a number of data elements associated with it and
they can be retrieved by specifying a role (see <a href="qt.html#ItemDataRole-enum">Qt.ItemDataRole</a>) to the model's
<a href="qabstractitemmodel.html#data">data</a>() function. Data
for all available roles can be obtained at the same time using the
<a href="qabstractitemmodel.html#itemData">itemData</a>()
function.</p>
<p>Data for each role is set using a particular <a href="qt.html#ItemDataRole-enum">Qt.ItemDataRole</a>. Data for
individual roles are set individually with <a href="qabstractitemmodel.html#setData">setData</a>(), or they can be set
for all roles with <a href="qabstractitemmodel.html#setItemData">setItemData</a>().</p>
<p>Items can be queried with <a href="qabstractitemmodel.html#flags">flags</a>() (see <a href="qt.html#ItemFlag-enum">Qt.ItemFlag</a>) to see if they can be
selected, dragged, or manipulated in other ways.</p>
<p>If an item has child objects, <a href="qabstractitemmodel.html#hasChildren">hasChildren</a>() returns
true for the corresponding index.</p>
<p>The model has a <a href="qabstractitemmodel.html#rowCount">rowCount</a>() and a <a href="qabstractitemmodel.html#columnCount">columnCount</a>() for each
level of the hierarchy. Rows and columns can be inserted and
removed with <a href="qabstractitemmodel.html#insertRows">insertRows</a>(), <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>(),
<a href="qabstractitemmodel.html#removeRows">removeRows</a>(), and
<a href="qabstractitemmodel.html#removeColumns">removeColumns</a>().</p>
<p>The model emits signals to indicate changes. For example,
<a href="qabstractitemmodel.html#dataChanged">dataChanged</a>() is
emitted whenever items of data made available by the model are
changed. Changes to the headers supplied by the model cause
<a href="qabstractitemmodel.html#headerDataChanged">headerDataChanged</a>()
to be emitted. If the structure of the underlying data changes, the
model can emit <a href="qabstractitemmodel.html#layoutChanged">layoutChanged</a>() to
indicate to any attached views that they should redisplay any items
shown, taking the new structure into account.</p>
<p>The items available through the model can be searched for
particular data using the <a href="qabstractitemmodel.html#match">match</a>() function.</p>
<p>To sort the model, you can use <a href="qabstractitemmodel.html#sort">sort</a>().</p>
<a id="subclassing" name="subclassing" />
<h3>Subclassing</h3>
<p><b>Note:</b> Some general guidelines for subclassing models are
available in the <a href="model-view-programming.html#model-subclassing-reference">Model
Subclassing Reference</a>.</p>
<p>When subclassing QAbstractItemModel, at the very least you must
implement <a href="qabstractitemmodel.html#index">index</a>(),
<a href="qabstractitemmodel.html#parent">parent</a>(), <a href="qabstractitemmodel.html#rowCount">rowCount</a>(), <a href="qabstractitemmodel.html#columnCount">columnCount</a>(), and
<a href="qabstractitemmodel.html#data">data</a>(). These functions
are used in all read-only models, and form the basis of editable
models.</p>
<p>You can also reimplement <a href="qabstractitemmodel.html#hasChildren">hasChildren</a>() to provide
special behavior for models where the implementation of <a href="qabstractitemmodel.html#rowCount">rowCount</a>() is expensive.
This makes it possible for models to restrict the amount of data
requested by views, and can be used as a way to implement lazy
population of model data.</p>
<p>To enable editing in your model, you must also implement
<a href="qabstractitemmodel.html#setData">setData</a>(), and
reimplement <a href="qabstractitemmodel.html#flags">flags</a>() to
ensure that <tt>ItemIsEditable</tt> is returned. You can also
reimplement <a href="qabstractitemmodel.html#headerData">headerData</a>() and <a href="qabstractitemmodel.html#setHeaderData">setHeaderData</a>() to
control the way the headers for your model are presented.</p>
<p>The <a href="qabstractitemmodel.html#dataChanged">dataChanged</a>() and
<a href="qabstractitemmodel.html#headerDataChanged">headerDataChanged</a>()
signals must be emitted explicitly when reimplementing the <a href="qabstractitemmodel.html#setData">setData</a>() and <a href="qabstractitemmodel.html#setHeaderData">setHeaderData</a>()
functions, respectively.</p>
<p>Custom models need to create model indexes for other components
to use. To do this, call <a href="qabstractitemmodel.html#createIndex">createIndex</a>() with
suitable row and column numbers for the item, and an identifier for
it, either as a pointer or as an integer value. The combination of
these values must be unique for each item. Custom models typically
use these unique identifiers in other reimplemented functions to
retrieve item data and access information about the item's parents
and children. See the <a href="itemviews-simpletreemodel.html">Simple Tree Model Example</a> for
more information about unique identifiers.</p>
<p>It is not necessary to support every role defined in <a href="qt.html#ItemDataRole-enum">Qt.ItemDataRole</a>. Depending on the
type of data contained within a model, it may only be useful to
implement the <a href="qabstractitemmodel.html#data">data</a>()
function to return valid information for some of the more common
roles. Most models provide at least a textual representation of
item data for the <a href="qt.html#ItemDataRole-enum">Qt.DisplayRole</a>, and well-behaved
models should also provide valid information for the <a href="qt.html#ItemDataRole-enum">Qt.ToolTipRole</a> and <a href="qt.html#ItemDataRole-enum">Qt.WhatsThisRole</a>. Supporting these
roles enables models to be used with standard Qt views. However,
for some models that handle highly-specialized data, it may be
appropriate to provide data only for user-defined roles.</p>
<p>Models that provide interfaces to resizable data structures can
provide implementations of <a href="qabstractitemmodel.html#insertRows">insertRows</a>(), <a href="qabstractitemmodel.html#removeRows">removeRows</a>(), <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>(),and
<a href="qabstractitemmodel.html#removeColumns">removeColumns</a>(). When
implementing these functions, it is important to notify any
connected views about changes to the model's dimensions both
<i>before</i> and <i>after</i> they occur:</p>
<ul>
<li>An <a href="qabstractitemmodel.html#insertRows">insertRows</a>()
implementation must call <a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a>()
<i>before</i> inserting new rows into the data structure, and
<a href="qabstractitemmodel.html#endInsertRows">endInsertRows</a>()
<i>immediately afterwards</i>.</li>
<li>An <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>()
implementation must call <a href="qabstractitemmodel.html#beginInsertColumns">beginInsertColumns</a>()
<i>before</i> inserting new columns into the data structure, and
<a href="qabstractitemmodel.html#endInsertColumns">endInsertColumns</a>()
<i>immediately afterwards</i>.</li>
<li>A <a href="qabstractitemmodel.html#removeRows">removeRows</a>()
implementation must call <a href="qabstractitemmodel.html#beginRemoveRows">beginRemoveRows</a>()
<i>before</i> the rows are removed from the data structure, and
<a href="qabstractitemmodel.html#endRemoveRows">endRemoveRows</a>()
<i>immediately afterwards</i>.</li>
<li>A <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>()
implementation must call <a href="qabstractitemmodel.html#beginRemoveColumns">beginRemoveColumns</a>()
<i>before</i> the columns are removed from the data structure, and
<a href="qabstractitemmodel.html#endRemoveColumns">endRemoveColumns</a>()
<i>immediately afterwards</i>.</li>
</ul>
<p>The <i>private</i> signals that these functions emit give
attached components the chance to take action before any data
becomes unavailable. The encapsulation of the insert and remove
operations with these begin and end functions also enables the
model to manage <a href="qpersistentmodelindex.html">persistent
model indexes</a> correctly. <b>If you want selections to be
handled properly, you must ensure that you call these
functions.</b> If you insert or remove an item with children, you
do not need to call these functions for the child items. In other
words, the parent item will take care of its child items.</p>
<p>To create models that populate incrementally, you can
reimplement <a href="qabstractitemmodel.html#fetchMore">fetchMore</a>() and <a href="qabstractitemmodel.html#canFetchMore">canFetchMore</a>(). If the
reimplementation of <a href="qabstractitemmodel.html#fetchMore">fetchMore</a>() adds rows to
the model, <a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows()</a> and
<a href="qabstractitemmodel.html#endInsertRows">endInsertRows()</a>
must be called.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QAbstractItemModel" />QAbstractItemModel.__init__ (<i>self</i>, <a href="qobject.html">QObject</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an abstract item model with the given
<i>parent</i>.</p>


<h3 class="fn"><a name="beginInsertColumns" />QAbstractItemModel.beginInsertColumns (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>, int&#160;<i>first</i>, int&#160;<i>last</i>)</h3><p>Begins a column insertion operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>() in a
subclass, you must call this function <i>before</i> inserting data
into the model's underlying data store.</p>
<p>The <i>parent</i> index corresponds to the parent into which the
new columns are inserted; <i>first</i> and <i>last</i> are the
column numbers of the new columns will have after they have been
inserted.</p>
<table class="generic" width="80%">
<tr class="odd" valign="top">
<td><img alt="Inserting columns" src="images/modelview-begin-insert-columns.png" /></td>
<td>Specify the first and last column numbers for the span of
columns you want to insert into an item in a model.
<p>For example, as shown in the diagram, we insert three columns
before column 4, so <i>first</i> is 4 and <i>last</i> is 6:</p>
<pre class="cpp">
 beginInsertColumns(parent<span class="operator">,</span> <span class="number">4</span><span class="operator">,</span> <span class="number">6</span>);
</pre>
<p>This inserts the three new columns as columns 4, 5, and 6.</p>
</td>
</tr>
<tr class="even" valign="top">
<td><img alt="Appending columns" src="images/modelview-begin-append-columns.png" /></td>
<td>To append columns, insert them after the last column.
<p>For example, as shown in the diagram, we append three columns to
a collection of six existing columns (ending in column 5), so
<i>first</i> is 6 and <i>last</i> is 8:</p>
<pre class="cpp">
 beginInsertColumns(parent<span class="operator">,</span> <span class="number">6</span><span class="operator">,</span> <span class="number">8</span>);
</pre>
<p>This appends the two new columns as columns 6, 7, and 8.</p>
</td>
</tr>
</table>
<p><b>Note:</b> This function emits the <a href="qabstractitemmodel.html#columnsAboutToBeInserted">columnsAboutToBeInserted</a>()
signal which connected views (or proxies) must handle before the
data is inserted. Otherwise, the views may end up in an invalid
state.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#endInsertColumns">endInsertColumns</a>().</p>


<h3 class="fn"><a name="beginInsertRows" />QAbstractItemModel.beginInsertRows (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>, int&#160;<i>first</i>, int&#160;<i>last</i>)</h3><p>Begins a row insertion operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#insertRows">insertRows</a>() in a
subclass, you must call this function <i>before</i> inserting data
into the model's underlying data store.</p>
<p>The <i>parent</i> index corresponds to the parent into which the
new rows are inserted; <i>first</i> and <i>last</i> are the row
numbers that the new rows will have after they have been
inserted.</p>
<table class="generic" width="80%">
<tr class="odd" valign="top">
<td><img alt="Inserting rows" src="images/modelview-begin-insert-rows.png" /></td>
<td>Specify the first and last row numbers for the span of rows you
want to insert into an item in a model.
<p>For example, as shown in the diagram, we insert three rows
before row 2, so <i>first</i> is 2 and <i>last</i> is 4:</p>
<pre class="cpp">
 beginInsertRows(parent<span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">4</span>);
</pre>
<p>This inserts the three new rows as rows 2, 3, and 4.</p>
</td>
</tr>
<tr class="even" valign="top">
<td><img alt="Appending rows" src="images/modelview-begin-append-rows.png" /></td>
<td>To append rows, insert them after the last row.
<p>For example, as shown in the diagram, we append two rows to a
collection of 4 existing rows (ending in row 3), so <i>first</i> is
4 and <i>last</i> is 5:</p>
<pre class="cpp">
 beginInsertRows(parent<span class="operator">,</span> <span class="number">4</span><span class="operator">,</span> <span class="number">5</span>);
</pre>
<p>This appends the two new rows as rows 4 and 5.</p>
</td>
</tr>
</table>
<p><b>Note:</b> This function emits the <a href="qabstractitemmodel.html#rowsAboutToBeInserted">rowsAboutToBeInserted</a>()
signal which connected views (or proxies) must handle before the
data is inserted. Otherwise, the views may end up in an invalid
state.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#endInsertRows">endInsertRows</a>().</p>


<h3 class="fn"><a name="beginMoveColumns" />bool QAbstractItemModel.beginMoveColumns (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>sourceParent</i>, int&#160;<i>sourceFirst</i>, int&#160;<i>sourceLast</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>destinationParent</i>, int&#160;<i>destinationColumn</i>)</h3><p>Begins a column move operation.</p>
<p>When reimplementing a subclass, this method simplifies moving
entities in your model. This method is responsible for moving
persistent indexes in the model, which you would otherwise be
required to do yourself. Using beginMoveRows and endMoveRows is an
alternative to emitting layoutAboutToBeChanged and layoutChanged
directly along with changePersistentIndexes. layoutAboutToBeChanged
is emitted by this method for compatibility reasons.</p>
<p>The <i>sourceParent</i> index corresponds to the parent from
which the columns are moved; <i>sourceFirst</i> and
<i>sourceLast</i> are the first and last column numbers of the
columns to be moved. The <i>destinationParent</i> index corresponds
to the parent into which those columns are moved. The
<i>destinationChild</i> is the column to which the columns will be
moved. That is, the index at column <i>sourceFirst</i> in
<i>sourceParent</i> will become column <i>destinationChild</i> in
<i>destinationParent</i>, followed by all other columns up to
<i>sourceLast</i>.</p>
<p>However, when moving columns down in the same parent
(<i>sourceParent</i> and <i>destinationParent</i> are equal), the
columnss will be placed before the <i>destinationChild</i> index.
That is, if you wish to move columns 0 and 1 so they will become
columns 1 and 2, <i>destinationChild</i> should be 3. In this case,
the new index for the source column <tt>i</tt> (which is between
<i>sourceFirst</i> and <i>sourceLast</i>) is equal to
<tt>(destinationChild-sourceLast-1+i)</tt>.</p>
<p>Note that if <i>sourceParent</i> and <i>destinationParent</i>
are the same, you must ensure that the <i>destinationChild</i> is
not within the range of <i>sourceFirst</i> and <i>sourceLast</i> +
1. You must also ensure that you do not attempt to move a column to
one of its own children or ancestors. This method returns false if
either condition is true, in which case you should abort your move
operation.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#endMoveColumns">endMoveColumns</a>().</p>


<h3 class="fn"><a name="beginMoveRows" />bool QAbstractItemModel.beginMoveRows (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>sourceParent</i>, int&#160;<i>sourceFirst</i>, int&#160;<i>sourceLast</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>destinationParent</i>, int&#160;<i>destinationRow</i>)</h3><p>Begins a row move operation.</p>
<p>When reimplementing a subclass, this method simplifies moving
entities in your model. This method is responsible for moving
persistent indexes in the model, which you would otherwise be
required to do yourself. Using beginMoveRows and endMoveRows is an
alternative to emitting layoutAboutToBeChanged and layoutChanged
directly along with changePersistentIndexes. layoutAboutToBeChanged
is emitted by this method for compatibility reasons.</p>
<p>The <i>sourceParent</i> index corresponds to the parent from
which the rows are moved; <i>sourceFirst</i> and <i>sourceLast</i>
are the first and last row numbers of the rows to be moved. The
<i>destinationParent</i> index corresponds to the parent into which
those rows are moved. The <i>destinationChild</i> is the row to
which the rows will be moved. That is, the index at row
<i>sourceFirst</i> in <i>sourceParent</i> will become row
<i>destinationChild</i> in <i>destinationParent</i>, followed by
all other rows up to <i>sourceLast</i>.</p>
<p>However, when moving rows down in the same parent
(<i>sourceParent</i> and <i>destinationParent</i> are equal), the
rows will be placed before the <i>destinationChild</i> index. That
is, if you wish to move rows 0 and 1 so they will become rows 1 and
2, <i>destinationChild</i> should be 3. In this case, the new index
for the source row <tt>i</tt> (which is between <i>sourceFirst</i>
and <i>sourceLast</i>) is equal to
<tt>(destinationChild-sourceLast-1+i)</tt>.</p>
<p>Note that if <i>sourceParent</i> and <i>destinationParent</i>
are the same, you must ensure that the <i>destinationChild</i> is
not within the range of <i>sourceFirst</i> and <i>sourceLast</i> +
1. You must also ensure that you do not attempt to move a row to
one of its own children or ancestors. This method returns false if
either condition is true, in which case you should abort your move
operation.</p>
<table class="generic" width="80%">
<tr class="odd" valign="top">
<td><img alt="Moving rows to another parent" src="images/modelview-move-rows-1.png" /></td>
<td>Specify the first and last row numbers for the span of rows in
the source parent you want to move in the model. Also specify the
row in the destination parent to move the span to.
<p>For example, as shown in the diagram, we move three rows from
row 2 to 4 in the source, so <i>sourceFirst</i> is 2 and
<i>sourceLast</i> is 4. We move those items to above row 2 in the
destination, so <i>destinationChild</i> is 2.</p>
<pre class="cpp">
 beginMoveRows(sourceParent<span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">4</span><span class="operator">,</span> destinationParent<span class="operator">,</span> <span class="number">2</span>);
</pre>
<p>This moves the three rows rows 2, 3, and 4 in the source to
become 2, 3 and 4 in the destination. Other affected siblings are
displaced accordingly.</p>
</td>
</tr>
<tr class="even" valign="top">
<td><img alt="Moving rows to append to another parent" src="images/modelview-move-rows-2.png" /></td>
<td>To append rows to another parent, move them to after the last
row.
<p>For example, as shown in the diagram, we move three rows to a
collection of 6 existing rows (ending in row 5), so
<i>destinationChild</i> is 6:</p>
<pre class="cpp">
 beginMoveRows(sourceParent<span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">4</span><span class="operator">,</span> destinationParent<span class="operator">,</span> <span class="number">6</span>);
</pre>
<p>This moves the target rows to the end of the target parent as 6,
7 and 8.</p>
</td>
</tr>
<tr class="odd" valign="top">
<td><img alt="Moving rows in the same parent up" src="images/modelview-move-rows-3.png" /></td>
<td>To move rows within the same parent, specify the row to move
them to.
<p>For example, as shown in the diagram, we move one item from row
2 to row 0, so <i>sourceFirst</i> and <i>sourceLast</i> are 2 and
<i>destinationChild</i> is 0.</p>
<pre class="cpp">
 beginMoveRows(parent<span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> parent<span class="operator">,</span> <span class="number">0</span>);
</pre>
<p>Note that other rows may be displaced accordingly. Note also
that when moving items within the same parent you should not
attempt invalid or no-op moves. In the above example, item 2 is at
row 2 before the move, so it can not be moved to row 2 (where it is
already) or row 3 (no-op as row 3 means above row 3, where it is
already)</p>
</td>
</tr>
<tr class="even" valign="top">
<td><img alt="Moving rows in the same parent down" src="images/modelview-move-rows-4.png" /></td>
<td>To move rows within the same parent, specify the row to move
them to.
<p>For example, as shown in the diagram, we move one item from row
2 to row 4, so <i>sourceFirst</i> and <i>sourceLast</i> are 2 and
<i>destinationChild</i> is 4.</p>
<pre class="cpp">
 beginMoveRows(parent<span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> parent<span class="operator">,</span> <span class="number">4</span>);
</pre>
<p>Note that other rows may be displaced accordingly.</p>
</td>
</tr>
</table>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#endMoveRows">endMoveRows</a>().</p>


<h3 class="fn"><a name="beginRemoveColumns" />QAbstractItemModel.beginRemoveColumns (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>, int&#160;<i>first</i>, int&#160;<i>last</i>)</h3><p>Begins a column removal operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>() in a
subclass, you must call this function <i>before</i> removing data
from the model's underlying data store.</p>
<p>The <i>parent</i> index corresponds to the parent from which the
new columns are removed; <i>first</i> and <i>last</i> are the
column numbers of the first and last columns to be removed.</p>
<table class="generic" width="80%">
<tr class="odd" valign="top">
<td><img alt="Removing columns" src="images/modelview-begin-remove-columns.png" /></td>
<td>Specify the first and last column numbers for the span of
columns you want to remove from an item in a model.
<p>For example, as shown in the diagram, we remove the three
columns from column 4 to column 6, so <i>first</i> is 4 and
<i>last</i> is 6:</p>
<pre class="cpp">
 beginRemoveColumns(parent<span class="operator">,</span> <span class="number">4</span><span class="operator">,</span> <span class="number">6</span>);
</pre></td>
</tr>
</table>
<p><b>Note:</b> This function emits the <a href="qabstractitemmodel.html#columnsAboutToBeRemoved">columnsAboutToBeRemoved</a>()
signal which connected views (or proxies) must handle before the
data is removed. Otherwise, the views may end up in an invalid
state.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#endRemoveColumns">endRemoveColumns</a>().</p>


<h3 class="fn"><a name="beginRemoveRows" />QAbstractItemModel.beginRemoveRows (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>, int&#160;<i>first</i>, int&#160;<i>last</i>)</h3><p>Begins a row removal operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#removeRows">removeRows</a>() in a
subclass, you must call this function <i>before</i> removing data
from the model's underlying data store.</p>
<p>The <i>parent</i> index corresponds to the parent from which the
new rows are removed; <i>first</i> and <i>last</i> are the row
numbers of the rows to be removed.</p>
<table class="generic" width="80%">
<tr class="odd" valign="top">
<td><img alt="Removing rows" src="images/modelview-begin-remove-rows.png" /></td>
<td>Specify the first and last row numbers for the span of rows you
want to remove from an item in a model.
<p>For example, as shown in the diagram, we remove the two rows
from row 2 to row 3, so <i>first</i> is 2 and <i>last</i> is 3:</p>
<pre class="cpp">
 beginRemoveRows(parent<span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">3</span>);
</pre></td>
</tr>
</table>
<p><b>Note:</b> This function emits the <a href="qabstractitemmodel.html#rowsAboutToBeRemoved">rowsAboutToBeRemoved</a>()
signal which connected views (or proxies) must handle before the
data is removed. Otherwise, the views may end up in an invalid
state.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#endRemoveRows">endRemoveRows</a>().</p>


<h3 class="fn"><a name="beginResetModel" />QAbstractItemModel.beginResetModel (<i>self</i>)</h3><p>Begins a model reset operation.</p>
<p>A reset operation resets the model to its current state in any
attached views.</p>
<p><b>Note:</b> Any views attached to this model will be reset as
well.</p>
<p>When a model is reset it means that any previous data reported
from the model is now invalid and has to be queried for again. This
also means that the current item and any selected items will become
invalid.</p>
<p>When a model radically changes its data it can sometimes be
easier to just call this function rather than emit <a href="qabstractitemmodel.html#dataChanged">dataChanged</a>() to inform
other components when the underlying data source, or its structure,
has changed.</p>
<p>You must call this function before resetting any internal data
structures in your model or proxy model.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#modelAboutToBeReset">modelAboutToBeReset</a>(),
<a href="qabstractitemmodel.html#modelReset">modelReset</a>(), and
<a href="qabstractitemmodel.html#endResetModel">endResetModel</a>().</p>


<h3 class="fn"><a name="buddy" /><a href="qmodelindex.html">QModelIndex</a> QAbstractItemModel.buddy (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns a model index for the buddy of the item represented by
<i>index</i>. When the user wants to edit an item, the view will
call this function to check whether another item in the model
should be edited instead. Then, the view will construct a delegate
using the model index returned by the buddy item.</p>
<p>The default implementation of this function has each item as its
own buddy.</p>


<h3 class="fn"><a name="canFetchMore" />bool QAbstractItemModel.canFetchMore (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>)</h3><p>Returns true if there is more data available for <i>parent</i>;
otherwise returns false.</p>
<p>The default implementation always returns false.</p>
<p>If canFetchMore() returns true, <a href="qabstractitemview.html">QAbstractItemView</a> will call <a href="qabstractitemmodel.html#fetchMore">fetchMore</a>(). However, the
<a href="qabstractitemmodel.html#fetchMore">fetchMore</a>()
function is only called when the model is being populated
incrementally.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#fetchMore">fetchMore</a>().</p>


<h3 class="fn"><a name="changePersistentIndex" />QAbstractItemModel.changePersistentIndex (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>from</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>to</i>)</h3><p>Changes the <a href="qpersistentmodelindex.html">QPersistentModelIndex</a> that is
equal to the given <i>from</i> model index to the given <i>to</i>
model index.</p>
<p>If no persistent model index equal to the given <i>from</i>
model index was found, nothing is changed.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#persistentIndexList">persistentIndexList</a>()
and <a href="qabstractitemmodel.html#changePersistentIndexList">changePersistentIndexList</a>().</p>


<h3 class="fn"><a name="changePersistentIndexList" />QAbstractItemModel.changePersistentIndexList (<i>self</i>, list-of-QModelIndex&#160;<i>from</i>, list-of-QModelIndex&#160;<i>to</i>)</h3><p>Changes the QPersistentModelIndexes that is equal to the indexes
in the given <i>from</i> model index list to the given <i>to</i>
model index list.</p>
<p>If no persistent model indexes equal to the indexes in the given
<i>from</i> model index list was found, nothing is changed.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#persistentIndexList">persistentIndexList</a>()
and <a href="qabstractitemmodel.html#changePersistentIndex">changePersistentIndex</a>().</p>


<h3 class="fn"><a name="columnCount" />int QAbstractItemModel.columnCount (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the number of columns for the children of the given
<i>parent</i>.</p>
<p>In most subclasses, the number of columns is independent of the
<i>parent</i>.</p>
<p>For example:</p>
<pre class="cpp">
 <span class="type">int</span> DomModel<span class="operator">.</span>columnCount(<span class="keyword">const</span> <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> <span class="operator">&amp;</span><span class="comment">/*parent*/</span>) <span class="keyword">const</span>
 {
     <span class="keyword">return</span> <span class="number">3</span>;
 }
</pre>
<p><b>Note:</b> When implementing a table based model,
columnCount() should return 0 when the parent is valid.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#rowCount">rowCount</a>().</p>


<h3 class="fn"><a name="createIndex" /><a href="qmodelindex.html">QModelIndex</a> QAbstractItemModel.createIndex (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, object&#160;<i>object</i>&#160;=&#160;0)</h3><p>Creates a model index for the given <i>row</i> and <i>column</i>
with the internal pointer <i>ptr</i>.</p>
<p>When using a <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a>, its indexes
have their own internal pointer. It is not advisable to access this
internal pointer outside of the model. Use the <a href="qabstractitemmodel.html#data">data</a>() function instead.</p>
<p>This function provides a consistent interface that model
subclasses must use to create model indexes.</p>


<h3 class="fn"><a name="data" />QVariant QAbstractItemModel.data (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>, int&#160;<i>role</i>&#160;=&#160;Qt.DisplayRole)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the data stored under the given <i>role</i> for the item
referred to by the <i>index</i>.</p>
<p><b>Note:</b> If you do not have a value to return, return an
<b>invalid</b> <a href="qvariant.html">QVariant</a> instead of
returning 0.</p>
<p><b>See also</b> <a href="qt.html#ItemDataRole-enum">Qt.ItemDataRole</a>, <a href="qabstractitemmodel.html#setData">setData</a>(), and <a href="qabstractitemmodel.html#headerData">headerData</a>().</p>


<h3 class="fn"><a name="decodeData" />bool QAbstractItemModel.decodeData (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>, <a href="qdatastream.html">QDataStream</a>&#160;<i>stream</i>)</h3><h3 class="fn"><a name="dropMimeData" />bool QAbstractItemModel.dropMimeData (<i>self</i>, <a href="qmimedata.html">QMimeData</a>&#160;<i>data</i>, <a href="qt.html#DropAction-enum">Qt.DropAction</a>&#160;<i>action</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>)</h3><p>Handles the <i>data</i> supplied by a drag and drop operation
that ended with the given <i>action</i>.</p>
<p>Returns true if the data and action can be handled by the model;
otherwise returns false.</p>
<p>The specified <i>row</i>, <i>column</i> and <i>parent</i>
indicate the location of an item in the model where the operation
ended. It is the responsibility of the model to complete the action
at the correct location.</p>
<p>For instance, a drop action on an item in a <a href="qtreeview.html">QTreeView</a> can result in new items either being
inserted as children of the item specified by <i>row</i>,
<i>column</i>, and <i>parent</i>, or as siblings of the item.</p>
<p>When <i>row</i> and <i>column</i> are -1 it means that the
dropped data should be considered as dropped directly on
<i>parent</i>. Usually this will mean appending the data as child
items of <i>parent</i>. If <i>row</i> and column are greater than
or equal zero, it means that the drop occurred just before the
specified <i>row</i> and <i>column</i> in the specified
<i>parent</i>.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#supportedDropActions">supportedDropActions</a>()
and <a href="model-view-programming.html#using-drag-and-drop-with-item-views">Using
drag and drop with item views</a>.</p>


<h3 class="fn"><a name="encodeData" />QAbstractItemModel.encodeData (<i>self</i>, list-of-QModelIndex&#160;<i>indexes</i>, <a href="qdatastream.html">QDataStream</a>&#160;<i>stream</i>)</h3><h3 class="fn"><a name="endInsertColumns" />QAbstractItemModel.endInsertColumns (<i>self</i>)</h3><p>Ends a column insertion operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>() in a
subclass, you must call this function <i>after</i> inserting data
into the model's underlying data store.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#beginInsertColumns">beginInsertColumns</a>().</p>


<h3 class="fn"><a name="endInsertRows" />QAbstractItemModel.endInsertRows (<i>self</i>)</h3><p>Ends a row insertion operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#insertRows">insertRows</a>() in a
subclass, you must call this function <i>after</i> inserting data
into the model's underlying data store.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a>().</p>


<h3 class="fn"><a name="endMoveColumns" />QAbstractItemModel.endMoveColumns (<i>self</i>)</h3><p>Ends a column move operation.</p>
<p>When implementing a subclass, you must call this function
<i>after</i> moving data within the model's underlying data
store.</p>
<p>layoutChanged is emitted by this method for compatibility
reasons.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#beginMoveColumns">beginMoveColumns</a>().</p>


<h3 class="fn"><a name="endMoveRows" />QAbstractItemModel.endMoveRows (<i>self</i>)</h3><p>Ends a row move operation.</p>
<p>When implementing a subclass, you must call this function
<i>after</i> moving data within the model's underlying data
store.</p>
<p>layoutChanged is emitted by this method for compatibility
reasons.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#beginMoveRows">beginMoveRows</a>().</p>


<h3 class="fn"><a name="endRemoveColumns" />QAbstractItemModel.endRemoveColumns (<i>self</i>)</h3><p>Ends a column removal operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>() in a
subclass, you must call this function <i>after</i> removing data
from the model's underlying data store.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#beginRemoveColumns">beginRemoveColumns</a>().</p>


<h3 class="fn"><a name="endRemoveRows" />QAbstractItemModel.endRemoveRows (<i>self</i>)</h3><p>Ends a row removal operation.</p>
<p>When reimplementing <a href="qabstractitemmodel.html#removeRows">removeRows</a>() in a
subclass, you must call this function <i>after</i> removing data
from the model's underlying data store.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#beginRemoveRows">beginRemoveRows</a>().</p>


<h3 class="fn"><a name="endResetModel" />QAbstractItemModel.endResetModel (<i>self</i>)</h3><p>Completes a model reset operation.</p>
<p>You must call this function after resetting any internal data
structure in your model or proxy model.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#beginResetModel">beginResetModel</a>().</p>


<h3 class="fn"><a name="fetchMore" />QAbstractItemModel.fetchMore (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>)</h3><p>Fetches any available data for the items with the parent
specified by the <i>parent</i> index.</p>
<p>Reimplement this if you are populating your model
incrementally.</p>
<p>The default implementation does nothing.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#canFetchMore">canFetchMore</a>().</p>


<h3 class="fn"><a name="flags" /><a href="qt-itemflags.html">Qt.ItemFlags</a> QAbstractItemModel.flags (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns the item flags for the given <i>index</i>.</p>
<p>The base class implementation returns a combination of flags
that enables the item (<tt>ItemIsEnabled</tt>) and allows it to be
selected (<tt>ItemIsSelectable</tt>).</p>
<p><b>See also</b> <a href="qt.html#ItemFlag-enum">Qt.ItemFlags</a>.</p>


<h3 class="fn"><a name="hasChildren" />bool QAbstractItemModel.hasChildren (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>Returns true if <i>parent</i> has any children; otherwise
returns false.</p>
<p>Use <a href="qabstractitemmodel.html#rowCount">rowCount</a>() on
the parent to find out the number of children.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#parent">parent</a>() and <a href="qabstractitemmodel.html#index">index</a>().</p>


<h3 class="fn"><a name="hasIndex" />bool QAbstractItemModel.hasIndex (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>Returns true if the model returns a valid <a href="qmodelindex.html">QModelIndex</a> for <i>row</i> and <i>column</i>
with <i>parent</i>, otherwise returns false.</p>


<h3 class="fn"><a name="headerData" />QVariant QAbstractItemModel.headerData (<i>self</i>, int&#160;<i>section</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>&#160;<i>orientation</i>, int&#160;<i>role</i>&#160;=&#160;Qt.DisplayRole)</h3><p>Returns the data for the given <i>role</i> and <i>section</i> in
the header with the specified <i>orientation</i>.</p>
<p>For horizontal headers, the section number corresponds to the
column number. Similarly, for vertical headers, the section number
corresponds to the row number.</p>
<p><b>See also</b> <a href="qt.html#ItemDataRole-enum">Qt.ItemDataRole</a>, <a href="qabstractitemmodel.html#setHeaderData">setHeaderData</a>(), and
<a href="qheaderview.html">QHeaderView</a>.</p>


<h3 class="fn"><a name="index" /><a href="qmodelindex.html">QModelIndex</a> QAbstractItemModel.index (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the index of the item in the model specified by the
given <i>row</i>, <i>column</i> and <i>parent</i> index.</p>
<p>When reimplementing this function in a subclass, call <a href="qabstractitemmodel.html#createIndex">createIndex</a>() to generate
model indexes that other components can use to refer to items in
your model.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#createIndex">createIndex</a>().</p>


<h3 class="fn"><a name="insertColumn" />bool QAbstractItemModel.insertColumn (<i>self</i>, int&#160;<i>column</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>Inserts a single column before the given <i>column</i> in the
child items of the <i>parent</i> specified.</p>
<p>Returns true if the column is inserted; otherwise returns
false.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>(),
<a href="qabstractitemmodel.html#insertRow">insertRow</a>(), and
<a href="qabstractitemmodel.html#removeColumn">removeColumn</a>().</p>


<h3 class="fn"><a name="insertColumns" />bool QAbstractItemModel.insertColumns (<i>self</i>, int&#160;<i>column</i>, int&#160;<i>count</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>On models that support this, inserts <i>count</i> new columns
into the model before the given <i>column</i>. The items in each
new column will be children of the item represented by the
<i>parent</i> model index.</p>
<p>If <i>column</i> is 0, the columns are prepended to any existing
columns.</p>
<p>If <i>column</i> is <a href="qabstractitemmodel.html#columnCount">columnCount</a>(), the
columns are appended to any existing columns.</p>
<p>If <i>parent</i> has no children, a single row with <i>count</i>
columns is inserted.</p>
<p>Returns true if the columns were successfully inserted;
otherwise returns false.</p>
<p>The base class implementation does nothing and returns
false.</p>
<p>If you implement your own model, you can reimplement this
function if you want to support insertions. Alternatively, you can
provide your own API for altering the data.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#insertRows">insertRows</a>(), <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>(),
<a href="qabstractitemmodel.html#beginInsertColumns">beginInsertColumns</a>(),
and <a href="qabstractitemmodel.html#endInsertColumns">endInsertColumns</a>().</p>


<h3 class="fn"><a name="insertRow" />bool QAbstractItemModel.insertRow (<i>self</i>, int&#160;<i>row</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p><b>Note:</b> The base class implementation of this function does
nothing and returns false.</p>
<p>Inserts a single row before the given <i>row</i> in the child
items of the <i>parent</i> specified.</p>
<p>Returns true if the row is inserted; otherwise returns
false.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#insertRows">insertRows</a>(), <a href="qabstractitemmodel.html#insertColumn">insertColumn</a>(), and
<a href="qabstractitemmodel.html#removeRow">removeRow</a>().</p>


<h3 class="fn"><a name="insertRows" />bool QAbstractItemModel.insertRows (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>count</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p><b>Note:</b> The base class implementation of this function does
nothing and returns false.</p>
<p>On models that support this, inserts <i>count</i> rows into the
model before the given <i>row</i>. Items in the new row will be
children of the item represented by the <i>parent</i> model
index.</p>
<p>If <i>row</i> is 0, the rows are prepended to any existing rows
in the parent.</p>
<p>If <i>row</i> is <a href="qabstractitemmodel.html#rowCount">rowCount</a>(), the rows are
appended to any existing rows in the parent.</p>
<p>If <i>parent</i> has no children, a single column with
<i>count</i> rows is inserted.</p>
<p>Returns true if the rows were successfully inserted; otherwise
returns false.</p>
<p>If you implement your own model, you can reimplement this
function if you want to support insertions. Alternatively, you can
provide your own API for altering the data. In either case, you
will need to call <a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a>() and
<a href="qabstractitemmodel.html#endInsertRows">endInsertRows</a>()
to notify other components that the model has changed.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>(),
<a href="qabstractitemmodel.html#removeRows">removeRows</a>(),
<a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a>(),
and <a href="qabstractitemmodel.html#endInsertRows">endInsertRows</a>().</p>


<h3 class="fn"><a name="itemData" />dict-of-int-QVariant QAbstractItemModel.itemData (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns a map with values for all predefined roles in the model
for the item at the given <i>index</i>.</p>
<p>Reimplement this function if you want to extend the default
behavior of this function to include custom roles in the map.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#setItemData">setItemData</a>(), <a href="qt.html#ItemDataRole-enum">Qt.ItemDataRole</a>, and <a href="qabstractitemmodel.html#data">data</a>().</p>


<h3 class="fn"><a name="match" />list-of-QModelIndex QAbstractItemModel.match (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>start</i>, int&#160;<i>role</i>, QVariant&#160;<i>value</i>, int&#160;<i>hits</i>&#160;=&#160;1, <a href="qt-matchflags.html">Qt.MatchFlags</a>&#160;<i>flags</i>&#160;=&#160;Qt.MatchStartsWith|Qt.MatchWrap)</h3><p>Returns a list of indexes for the items in the column of the
<i>start</i> index where data stored under the given <i>role</i>
matches the specified <i>value</i>. The way the search is performed
is defined by the <i>flags</i> given. The list that is returned may
be empty.</p>
<p>The search begins from the <i>start</i> index, and continues
until the number of matching data items equals <i>hits</i>, the
search reaches the last row, or the search reaches <i>start</i>
again - depending on whether <tt>MatchWrap</tt> is specified in
<i>flags</i>. If you want to search for all matching items, use
<i>hits</i> = -1.</p>
<p>By default, this function will perform a wrapping, string-based
comparison on all items, searching for items that begin with the
search term specified by <i>value</i>.</p>
<p><b>Note:</b> The default implementation of this function only
searches columns. Reimplement this function to include a different
search behavior.</p>


<h3 class="fn"><a name="mimeData" /><a href="qmimedata.html">QMimeData</a> QAbstractItemModel.mimeData (<i>self</i>, list-of-QModelIndex&#160;<i>indexes</i>)</h3><p>The <i>QMimeData</i> result</p><p>Returns an object that contains serialized items of data
corresponding to the list of <i>indexes</i> specified. The formats
used to describe the encoded data is obtained from the <a href="qabstractitemmodel.html#mimeTypes">mimeTypes</a>() function.</p>
<p>If the list of indexes is empty, or there are no supported MIME
types, 0 is returned rather than a serialized empty list.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#mimeTypes">mimeTypes</a>() and <a href="qabstractitemmodel.html#dropMimeData">dropMimeData</a>().</p>


<h3 class="fn"><a name="mimeTypes" />QStringList QAbstractItemModel.mimeTypes (<i>self</i>)</h3><p>Returns a list of MIME types that can be used to describe a list
of model indexes.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#mimeData">mimeData</a>().</p>


<h3 class="fn"><a name="parent" /><a href="qmodelindex.html">QModelIndex</a> QAbstractItemModel.parent (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>child</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the parent of the model item with the given
<i>index</i>. If the item has no parent, an invalid <a href="qmodelindex.html">QModelIndex</a> is returned.</p>
<p>A common convention used in models that expose tree data
structures is that only items in the first column have children.
For that case, when reimplementing this function in a subclass the
column of the returned <a href="qmodelindex.html">QModelIndex</a>
would be 0.</p>
<p>When reimplementing this function in a subclass, be careful to
avoid calling <a href="qmodelindex.html">QModelIndex</a> member
functions, such as <a href="qmodelindex.html#parent">QModelIndex.parent</a>(), since indexes
belonging to your model will simply call your implementation,
leading to infinite recursion.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#createIndex">createIndex</a>().</p>


<h3 class="fn"><a name="parent-2" /><a href="qobject.html">QObject</a> QAbstractItemModel.parent (<i>self</i>)</h3><h3 class="fn"><a name="persistentIndexList" />list-of-QModelIndex QAbstractItemModel.persistentIndexList (<i>self</i>)</h3><p>Returns the list of indexes stored as persistent indexes in the
model.</p>
<p>This function was introduced in Qt 4.2.</p>


<h3 class="fn"><a name="removeColumn" />bool QAbstractItemModel.removeColumn (<i>self</i>, int&#160;<i>column</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>Removes the given <i>column</i> from the child items of the
<i>parent</i> specified.</p>
<p>Returns true if the column is removed; otherwise returns
false.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>(),
<a href="qabstractitemmodel.html#removeRow">removeRow</a>(), and
<a href="qabstractitemmodel.html#insertColumn">insertColumn</a>().</p>


<h3 class="fn"><a name="removeColumns" />bool QAbstractItemModel.removeColumns (<i>self</i>, int&#160;<i>column</i>, int&#160;<i>count</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>On models that support this, removes <i>count</i> columns
starting with the given <i>column</i> under parent <i>parent</i>
from the model.</p>
<p>Returns true if the columns were successfully removed; otherwise
returns false.</p>
<p>The base class implementation does nothing and returns
false.</p>
<p>If you implement your own model, you can reimplement this
function if you want to support removing. Alternatively, you can
provide your own API for altering the data.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#removeColumn">removeColumn</a>(), <a href="qabstractitemmodel.html#removeRows">removeRows</a>(), <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>(),
<a href="qabstractitemmodel.html#beginRemoveColumns">beginRemoveColumns</a>(),
and <a href="qabstractitemmodel.html#endRemoveColumns">endRemoveColumns</a>().</p>


<h3 class="fn"><a name="removeRow" />bool QAbstractItemModel.removeRow (<i>self</i>, int&#160;<i>row</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>Removes the given <i>row</i> from the child items of the
<i>parent</i> specified.</p>
<p>Returns true if the row is removed; otherwise returns false.</p>
<p>This is a convenience function that calls <a href="qabstractitemmodel.html#removeRows">removeRows</a>(). The <a href="qabstractitemmodel.html">QAbstractItemModel</a> implementation of
<a href="qabstractitemmodel.html#removeRows">removeRows</a>() does
nothing.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#removeRows">removeRows</a>(), <a href="qabstractitemmodel.html#removeColumn">removeColumn</a>(), and
<a href="qabstractitemmodel.html#insertRow">insertRow</a>().</p>


<h3 class="fn"><a name="removeRows" />bool QAbstractItemModel.removeRows (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>count</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>On models that support this, removes <i>count</i> rows starting
with the given <i>row</i> under parent <i>parent</i> from the
model.</p>
<p>Returns true if the rows were successfully removed; otherwise
returns false.</p>
<p>The base class implementation does nothing and returns
false.</p>
<p>If you implement your own model, you can reimplement this
function if you want to support removing. Alternatively, you can
provide your own API for altering the data.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#removeRow">removeRow</a>(), <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>(),
<a href="qabstractitemmodel.html#insertColumns">insertColumns</a>(),
<a href="qabstractitemmodel.html#beginRemoveRows">beginRemoveRows</a>(),
and <a href="qabstractitemmodel.html#endRemoveRows">endRemoveRows</a>().</p>


<h3 class="fn"><a name="reset" />QAbstractItemModel.reset (<i>self</i>)</h3><p>Resets the model to its original state in any attached
views.</p>
<p><b>Note:</b> Use <a href="qabstractitemmodel.html#beginResetModel">beginResetModel</a>() and
<a href="qabstractitemmodel.html#endResetModel">endResetModel</a>()
instead whenever possible. Use this method only if there is no way
to call <a href="qabstractitemmodel.html#beginResetModel">beginResetModel</a>()
before invalidating the model. Otherwise it could lead to
unexpected behaviour, especially when used with proxy models.</p>


<h3 class="fn"><a name="resetInternalData" />QAbstractItemModel.resetInternalData (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void resetInternalData()</tt>.</p><p>This slot is called just after the internal data of a model is
cleared while it is being reset.</p>
<p>This slot is provided the convenience of subclasses of concrete
proxy models, such as subclasses of <a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a> which
maintain extra data.</p>
<pre class="cpp">
 <span class="keyword">class</span> CustomDataProxy : <span class="keyword">public</span> <span class="type"><a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a></span>
 {
     Q_OBJECT
 <span class="keyword">public</span>:
     CustomDataProxy(<span class="type"><a href="qobject.html">QObject</a></span> <span class="operator">*</span>parent)
       : <span class="type"><a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a></span>(parent)
     {
     }

     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>

     <span class="type"><a href="qvariant.html">QVariant</a></span> data(<span class="keyword">const</span> <span class="type"><a href="qmodelindex.html">QModelIndex</a></span> <span class="operator">&amp;</span>index<span class="operator">,</span> <span class="type">int</span> role)
     {
         <span class="keyword">if</span> (role <span class="operator">!</span><span class="operator">=</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>BackgroundRole)
             <span class="keyword">return</span> <span class="type"><a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a></span><span class="operator">.</span>data(index<span class="operator">,</span> role);

         <span class="keyword">if</span> (m_customData<span class="operator">.</span>contains(index<span class="operator">.</span>row()))
             <span class="keyword">return</span> m_customData<span class="operator">.</span>value(index<span class="operator">.</span>row());
         <span class="keyword">return</span> <span class="type"><a href="qsortfilterproxymodel.html">QSortFilterProxyModel</a></span><span class="operator">.</span>data(index<span class="operator">,</span> role);
     }

 <span class="keyword">private</span> <span class="keyword">slots</span>:
     <span class="type">void</span> resetInternalData()
     {
         m_customData<span class="operator">.</span>clear();
     }

 <span class="keyword">private</span>:
   <span class="type"><a href="qhash.html">QHash</a></span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">,</span> <span class="type"><a href="qvariant.html">QVariant</a></span><span class="operator">&gt;</span> m_customData;
 };
</pre>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#modelAboutToBeReset">modelAboutToBeReset</a>()
and <a href="qabstractitemmodel.html#modelReset">modelReset</a>().</p>


<h3 class="fn"><a name="revert" />QAbstractItemModel.revert (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void revert()</tt>.</p><p>Lets the model know that it should discard cached information.
This function is typically used for row editing.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#submit">submit</a>().</p>


<h3 class="fn"><a name="roleNames" />dict-of-int-QByteArray QAbstractItemModel.roleNames (<i>self</i>)</h3><p>Returns the model's role names.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#setRoleNames">setRoleNames</a>().</p>


<h3 class="fn"><a name="rowCount" />int QAbstractItemModel.rowCount (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the number of rows under the given <i>parent</i>. When
the parent is valid it means that rowCount is returning the number
of children of parent.</p>
<p><b>Note:</b> When implementing a table based model, rowCount()
should return 0 when the parent is valid.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#columnCount">columnCount</a>().</p>


<h3 class="fn"><a name="setData" />bool QAbstractItemModel.setData (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>, QVariant&#160;<i>value</i>, int&#160;<i>role</i>&#160;=&#160;Qt.EditRole)</h3><p>Sets the <i>role</i> data for the item at <i>index</i> to
<i>value</i>.</p>
<p>Returns true if successful; otherwise returns false.</p>
<p>The <a href="qabstractitemmodel.html#dataChanged">dataChanged</a>() signal
should be emitted if the data was successfully set.</p>
<p>The base class implementation returns false. This function and
<a href="qabstractitemmodel.html#data">data</a>() must be
reimplemented for editable models.</p>
<p><b>See also</b> <a href="qt.html#ItemDataRole-enum">Qt.ItemDataRole</a>, <a href="qabstractitemmodel.html#data">data</a>(), and <a href="qabstractitemmodel.html#itemData">itemData</a>().</p>


<h3 class="fn"><a name="setHeaderData" />bool QAbstractItemModel.setHeaderData (<i>self</i>, int&#160;<i>section</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>&#160;<i>orientation</i>, QVariant&#160;<i>value</i>, int&#160;<i>role</i>&#160;=&#160;Qt.EditRole)</h3><p>Sets the data for the given <i>role</i> and <i>section</i> in
the header with the specified <i>orientation</i> to the
<i>value</i> supplied.</p>
<p>Returns true if the header's data was updated; otherwise returns
false.</p>
<p>When reimplementing this function, the <a href="qabstractitemmodel.html#headerDataChanged">headerDataChanged</a>()
signal must be emitted explicitly.</p>
<p><b>See also</b> <a href="qt.html#ItemDataRole-enum">Qt.ItemDataRole</a> and <a href="qabstractitemmodel.html#headerData">headerData</a>().</p>


<h3 class="fn"><a name="setItemData" />bool QAbstractItemModel.setItemData (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>, dict-of-int-QVariant&#160;<i>roles</i>)</h3><p>Sets the role data for the item at <i>index</i> to the
associated value in <i>roles</i>, for every <a href="qt.html#ItemDataRole-enum">Qt.ItemDataRole</a>.</p>
<p>Returns true if successful; otherwise returns false.</p>
<p>Roles that are not in <i>roles</i> will not be modified.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#setData">setData</a>(), <a href="qabstractitemmodel.html#data">data</a>(), and <a href="qabstractitemmodel.html#itemData">itemData</a>().</p>


<h3 class="fn"><a name="setRoleNames" />QAbstractItemModel.setRoleNames (<i>self</i>, dict-of-int-QByteArray&#160;<i>roleNames</i>)</h3><p>Sets the model's role names to <i>roleNames</i>.</p>
<p>This function allows mapping of role identifiers to role
property names in Declarative UI. This function must be called
before the model is used. Modifying the role names after the model
has been set may result in undefined behaviour.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#roleNames">roleNames</a>().</p>


<h3 class="fn"><a name="setSupportedDragActions" />QAbstractItemModel.setSupportedDragActions (<i>self</i>, <a href="qt-dropactions.html">Qt.DropActions</a>)</h3><p>Sets the supported drag <i>actions</i> for the items in the
model.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#supportedDragActions">supportedDragActions</a>()
and <a href="model-view-programming.html#using-drag-and-drop-with-item-views">Using
drag and drop with item views</a>.</p>


<h3 class="fn"><a name="sibling" /><a href="qmodelindex.html">QModelIndex</a> QAbstractItemModel.sibling (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>idx</i>)</h3><p>Returns the sibling at <i>row</i> and <i>column</i> for the item
at <i>index</i>, or an invalid <a href="qmodelindex.html">QModelIndex</a> if there is no sibling at that
location.</p>
<p>sibling() is just a convenience function that finds the item's
parent, and uses it to retrieve the index of the child item in the
specified <i>row</i> and <i>column</i>.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#index">index</a>(), <a href="qmodelindex.html#row">QModelIndex.row</a>(), and <a href="qmodelindex.html#column">QModelIndex.column</a>().</p>


<h3 class="fn"><a name="sort" />QAbstractItemModel.sort (<i>self</i>, int&#160;<i>column</i>, <a href="qt.html#SortOrder-enum">Qt.SortOrder</a>&#160;<i>order</i>&#160;=&#160;Qt.AscendingOrder)</h3><p>Sorts the model by <i>column</i> in the given <i>order</i>.</p>
<p>The base class implementation does nothing.</p>


<h3 class="fn"><a name="span" /><a href="qsize.html">QSize</a> QAbstractItemModel.span (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns the row and column span of the item represented by
<i>index</i>.</p>
<p><b>Note:</b> Currently, span is not used.</p>


<h3 class="fn"><a name="submit" />bool QAbstractItemModel.submit (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>bool submit()</tt>.</p><p>Lets the model know that it should submit cached information to
permanent storage. This function is typically used for row
editing.</p>
<p>Returns true if there is no error; otherwise returns false.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#revert">revert</a>().</p>


<h3 class="fn"><a name="supportedDragActions" /><a href="qt-dropactions.html">Qt.DropActions</a> QAbstractItemModel.supportedDragActions (<i>self</i>)</h3><p>Returns the actions supported by the data in this model.</p>
<p>The default implementation returns <a href="qabstractitemmodel.html#supportedDropActions">supportedDropActions</a>()
unless specific values have been set with <a href="qabstractitemmodel.html#setSupportedDragActions">setSupportedDragActions</a>().</p>
<p>supportedDragActions() is used by <a href="qabstractitemview.html#startDrag">QAbstractItemView.startDrag</a>()
as the default values when a drag occurs.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#setSupportedDragActions">setSupportedDragActions</a>(),
<a href="qt.html#DropAction-enum">Qt.DropActions</a>, and <a href="model-view-programming.html#using-drag-and-drop-with-item-views">Using
drag and drop with item views</a>.</p>


<h3 class="fn"><a name="supportedDropActions" /><a href="qt-dropactions.html">Qt.DropActions</a> QAbstractItemModel.supportedDropActions (<i>self</i>)</h3><p>Returns the drop actions supported by this model.</p>
<p>The default implementation returns <a href="qt.html#DropAction-enum">Qt.CopyAction</a>. Reimplement this
function if you wish to support additional actions. You must also
reimplement the <a href="qabstractitemmodel.html#dropMimeData">dropMimeData</a>() function
to handle the additional operations.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#dropMimeData">dropMimeData</a>(), <a href="qt.html#DropAction-enum">Qt.DropActions</a>, and <a href="model-view-programming.html#using-drag-and-drop-with-item-views">Using
drag and drop with item views</a>.</p>
<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="columnsAboutToBeInserted" />void columnsAboutToBeInserted (const QModelIndex&amp;,int,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted just before columns are inserted into the
model. The new items will be positioned between <i>start</i> and
<i>end</i> inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt
to changes in the model's dimensions. It can only be emitted by the
<a href="qabstractitemmodel.html">QAbstractItemModel</a>
implementation, and cannot be explicitly emitted in subclass
code.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>() and
<a href="qabstractitemmodel.html#beginInsertColumns">beginInsertColumns</a>().</p>


<h3 class="fn"><a name="columnsAboutToBeMoved" />void columnsAboutToBeMoved (const QModelIndex&amp;,int,int,const QModelIndex&amp;,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted just before columns are moved within the
model. The items that will be moved are those between
<i>sourceStart</i> and <i>sourceEnd</i> inclusive, under the given
<i>sourceParent</i> item. They will be moved to
<i>destinationParent</i> starting at the column
<i>destinationColumn</i>.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt
to changes in the model's dimensions. It can only be emitted by the
<a href="qabstractitemmodel.html">QAbstractItemModel</a>
implementation, and cannot be explicitly emitted in subclass
code.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#beginMoveRows">beginMoveRows</a>().</p>


<h3 class="fn"><a name="columnsAboutToBeRemoved" />void columnsAboutToBeRemoved (const QModelIndex&amp;,int,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted just before columns are removed from the
model. The items to be removed are those between <i>start</i> and
<i>end</i> inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt
to changes in the model's dimensions. It can only be emitted by the
<a href="qabstractitemmodel.html">QAbstractItemModel</a>
implementation, and cannot be explicitly emitted in subclass
code.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>() and
<a href="qabstractitemmodel.html#beginRemoveColumns">beginRemoveColumns</a>().</p>


<h3 class="fn"><a name="columnsInserted" />void columnsInserted (const QModelIndex&amp;,int,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted after columns have been inserted into the
model. The new items are those between <i>start</i> and <i>end</i>
inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt
to changes in the model's dimensions. It can only be emitted by the
<a href="qabstractitemmodel.html">QAbstractItemModel</a>
implementation, and cannot be explicitly emitted in subclass
code.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#insertColumns">insertColumns</a>() and
<a href="qabstractitemmodel.html#beginInsertColumns">beginInsertColumns</a>().</p>


<h3 class="fn"><a name="columnsMoved" />void columnsMoved (const QModelIndex&amp;,int,int,const QModelIndex&amp;,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted after columns have been moved within the
model. The items between <i>sourceStart</i> and <i>sourceEnd</i>
inclusive, under the given <i>sourceParent</i> item have been moved
to <i>destinationParent</i> starting at the column
<i>destinationColumn</i>.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt
to changes in the model's dimensions. It can only be emitted by the
<a href="qabstractitemmodel.html">QAbstractItemModel</a>
implementation, and cannot be explicitly emitted in subclass
code.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#beginMoveRows">beginMoveRows</a>().</p>


<h3 class="fn"><a name="columnsRemoved" />void columnsRemoved (const QModelIndex&amp;,int,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted after columns have been removed from the
model. The removed items are those between <i>start</i> and
<i>end</i> inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt
to changes in the model's dimensions. It can only be emitted by the
<a href="qabstractitemmodel.html">QAbstractItemModel</a>
implementation, and cannot be explicitly emitted in subclass
code.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#removeColumns">removeColumns</a>() and
<a href="qabstractitemmodel.html#beginRemoveColumns">beginRemoveColumns</a>().</p>


<h3 class="fn"><a name="dataChanged" />void dataChanged (const QModelIndex&amp;,const QModelIndex&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the data in an existing item
changes.</p>
<p>If the items are of the same parent, the affected ones are those
between <i>topLeft</i> and <i>bottomRight</i> inclusive. If the
items do not have the same parent, the behavior is undefined.</p>
<p>When reimplementing the <a href="qabstractitemmodel.html#setData">setData</a>() function, this
signal must be emitted explicitly.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#headerDataChanged">headerDataChanged</a>(),
<a href="qabstractitemmodel.html#setData">setData</a>(), and
<a href="qabstractitemmodel.html#layoutChanged">layoutChanged</a>().</p>


<h3 class="fn"><a name="headerDataChanged" />void headerDataChanged (Qt::Orientation,int,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever a header is changed. The
<i>orientation</i> indicates whether the horizontal or vertical
header has changed. The sections in the header from the
<i>first</i> to the <i>last</i> need to be updated.</p>
<p>When reimplementing the <a href="qabstractitemmodel.html#setHeaderData">setHeaderData</a>()
function, this signal must be emitted explicitly.</p>
<p>If you are changing the number of columns or rows you do not
need to emit this signal, but use the begin/end functions (refer to
the section on subclassing in the <a href="qabstractitemmodel.html">QAbstractItemModel</a> class description
for details).</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#headerData">headerData</a>(), <a href="qabstractitemmodel.html#setHeaderData">setHeaderData</a>(), and
<a href="qabstractitemmodel.html#dataChanged">dataChanged</a>().</p>


<h3 class="fn"><a name="layoutAboutToBeChanged" />void layoutAboutToBeChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted just before the layout of a model is
changed. Components connected to this signal use it to adapt to
changes in the model's layout.</p>
<p>Subclasses should update any persistent model indexes after
emitting layoutAboutToBeChanged().</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#layoutChanged">layoutChanged</a>() and
<a href="qabstractitemmodel.html#changePersistentIndex">changePersistentIndex</a>().</p>


<h3 class="fn"><a name="layoutChanged" />void layoutChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the layout of items exposed by
the model has changed; for example, when the model has been sorted.
When this signal is received by a view, it should update the layout
of items to reflect this change.</p>
<p>When subclassing <a href="qabstractitemmodel.html">QAbstractItemModel</a> or <a href="qabstractproxymodel.html">QAbstractProxyModel</a>, ensure that you
emit <a href="qabstractitemmodel.html#layoutAboutToBeChanged">layoutAboutToBeChanged</a>()
before changing the order of items or altering the structure of the
data you expose to views, and emit layoutChanged() after changing
the layout.</p>
<p>Subclasses should update any persistent model indexes before
emitting layoutChanged(). In other words, when the structure
changes:</p>
<ul>
<li>emit layoutAboutToBeChanged</li>
<li>Remember the <a href="qmodelindex.html">QModelIndex</a> that
will change</li>
<li>Update your internal data</li>
<li>Call <a href="qabstractitemmodel.html#changePersistentIndex">changePersistentIndex</a>()</li>
<li>emit layoutChanged</li>
</ul>
<p><b>See also</b> <a href="qabstractitemmodel.html#layoutAboutToBeChanged">layoutAboutToBeChanged</a>(),
<a href="qabstractitemmodel.html#dataChanged">dataChanged</a>(),
<a href="qabstractitemmodel.html#headerDataChanged">headerDataChanged</a>(),
<a href="qabstractitemmodel.html#modelReset">modelReset</a>(), and
<a href="qabstractitemmodel.html#changePersistentIndex">changePersistentIndex</a>().</p>


<h3 class="fn"><a name="modelAboutToBeReset" />void modelAboutToBeReset ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when <a href="qabstractitemmodel.html#reset">reset</a>() is called, before the
model's internal state (e.g. persistent model indexes) has been
invalidated.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#beginResetModel">beginResetModel</a>() and
<a href="qabstractitemmodel.html#modelReset">modelReset</a>().</p>


<h3 class="fn"><a name="modelReset" />void modelReset ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when <a href="qabstractitemmodel.html#reset">reset</a>() is called, after the
model's internal state (e.g. persistent model indexes) has been
invalidated.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#endResetModel">endResetModel</a>() and
<a href="qabstractitemmodel.html#modelAboutToBeReset">modelAboutToBeReset</a>().</p>


<h3 class="fn"><a name="rowsAboutToBeInserted" />void rowsAboutToBeInserted (const QModelIndex&amp;,int,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted just before rows are inserted into the
model. The new items will be positioned between <i>start</i> and
<i>end</i> inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt
to changes in the model's dimensions. It can only be emitted by the
<a href="qabstractitemmodel.html">QAbstractItemModel</a>
implementation, and cannot be explicitly emitted in subclass
code.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#insertRows">insertRows</a>() and <a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a>().</p>


<h3 class="fn"><a name="rowsAboutToBeMoved" />void rowsAboutToBeMoved (const QModelIndex&amp;,int,int,const QModelIndex&amp;,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted just before rows are moved within the
model. The items that will be moved are those between
<i>sourceStart</i> and <i>sourceEnd</i> inclusive, under the given
<i>sourceParent</i> item. They will be moved to
<i>destinationParent</i> starting at the row
<i>destinationRow</i>.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt
to changes in the model's dimensions. It can only be emitted by the
<a href="qabstractitemmodel.html">QAbstractItemModel</a>
implementation, and cannot be explicitly emitted in subclass
code.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#beginMoveRows">beginMoveRows</a>().</p>


<h3 class="fn"><a name="rowsAboutToBeRemoved" />void rowsAboutToBeRemoved (const QModelIndex&amp;,int,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted just before rows are removed from the
model. The items that will be removed are those between
<i>start</i> and <i>end</i> inclusive, under the given
<i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt
to changes in the model's dimensions. It can only be emitted by the
<a href="qabstractitemmodel.html">QAbstractItemModel</a>
implementation, and cannot be explicitly emitted in subclass
code.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#removeRows">removeRows</a>() and <a href="qabstractitemmodel.html#beginRemoveRows">beginRemoveRows</a>().</p>


<h3 class="fn"><a name="rowsInserted" />void rowsInserted (const QModelIndex&amp;,int,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted after rows have been inserted into the
model. The new items are those between <i>start</i> and <i>end</i>
inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt
to changes in the model's dimensions. It can only be emitted by the
<a href="qabstractitemmodel.html">QAbstractItemModel</a>
implementation, and cannot be explicitly emitted in subclass
code.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#insertRows">insertRows</a>() and <a href="qabstractitemmodel.html#beginInsertRows">beginInsertRows</a>().</p>


<h3 class="fn"><a name="rowsMoved" />void rowsMoved (const QModelIndex&amp;,int,int,const QModelIndex&amp;,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted after rows have been moved within the
model. The items between <i>sourceStart</i> and <i>sourceEnd</i>
inclusive, under the given <i>sourceParent</i> item have been moved
to <i>destinationParent</i> starting at the row
<i>destinationRow</i>.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt
to changes in the model's dimensions. It can only be emitted by the
<a href="qabstractitemmodel.html">QAbstractItemModel</a>
implementation, and cannot be explicitly emitted in subclass
code.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#beginMoveRows">beginMoveRows</a>().</p>


<h3 class="fn"><a name="rowsRemoved" />void rowsRemoved (const QModelIndex&amp;,int,int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted after rows have been removed from the
model. The removed items are those between <i>start</i> and
<i>end</i> inclusive, under the given <i>parent</i> item.</p>
<p><b>Note:</b> Components connected to this signal use it to adapt
to changes in the model's dimensions. It can only be emitted by the
<a href="qabstractitemmodel.html">QAbstractItemModel</a>
implementation, and cannot be explicitly emitted in subclass
code.</p>
<p><b>See also</b> <a href="qabstractitemmodel.html#removeRows">removeRows</a>() and <a href="qabstractitemmodel.html#beginRemoveRows">beginRemoveRows</a>().</p>


<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.9.5-9eb6aac99275 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.3</td></tr></table></div></address></body></html>